#include<bits/stdc++.h>
using namespace std;
int cnt[100005], n, a[100005];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cin >> n;
    int tmp, nmax = -1;
    for(int i = 1; i <= n; i++){
        cin >> tmp;
        nmax = max(nmax, tmp);
        cnt[tmp]++;
    }
    int j = 1, las = 0;
    for(int i = 1; i <= 100000; i++){
        if(cnt[i] != 0){
            a[j++] = cnt[i];
            if(i == nmax){
                las = j;
                break;
            }
        }
    }
    int sum = 0, sum1 = n, nmin = 1000001;
    for(int i = 0 ; i <= las - 1; i++){
        nmin = min(sum, a[i + 1]);
        sum += a[i + 1];
        sum -= nmin;
        sum1 -= nmin;
    }
    cout << sum1;
    return 0;
}
